def staggered_add_for(m):
    if m <= 0:
        return "输入参数不符合要求"
    total = 0
    for i in range(m):
        temp = i % 2
        if temp == 0:
            total = total + (i + 1)
        else:
            total = total + (-1) * (i + 1)
    return total


def staggered_add_while(m):
    if m <= 0:
        return "输入参数不符合要求"
    total = 0
    i = 1
    while i <= m:
        temp = i % 2
        if temp == 0:
            total = total + (-1) * (i + 1)
        else:
            total = total + (i + 1)
        i = i + 1
    return total


num = input("请输入一个整数:")
num = int(num)
total1 = staggered_add_for(num)
total2 = staggered_add_while(num)
print(total1)
print(total2)
